A server-side application component can be utilized to encapsulate the business logic of an application. Here the server-side application component can be an instance of a programmable class (also referred to as class), which can be but is not limited to, a Java® bean, an Enterprise Java® Bean (EJB), an interface, a module, and other suitable concepts, and EJB will be used to illustrate the various embodiments of the invention in the following context. The instances of an EJB are created and managed at runtime by a container, which runs as part of an application server to provide enterprise applications with a high level of abstraction. An EJB can be customized at deployment time via a deployment descriptor, which allows the editing of both the structural and application assembly information about the EJB. An important type of EJB is the entity bean, which is a component that represents an object-oriented view of some entities stored in a persistent storage, such as a database, or entities that are implemented by an existing enterprise application. An EJB query component, such as an EJB Finder, can be deployed in the EJB to query a database using a query language, map and/or hydrate the matched data entities in the database to one or more EJB instances, and store them in a result set, which allows fast and easy access to the EJB instances. Here, the database can be a relational database, an Oracle Database, a MS SQL server, a DB2, and other suitable concepts.
EJB-QL was introduced as a standard query language to implement an EJB Finder. The chief advantage of EJB-QL is that it is a high-level, object query language that allows queries to be specified against an EJB object without requiring any knowledge of the underlying types of the databases or their Database Management Systems (DBMS). This makes the EJB Finder and EJB applications portable across different database products.
Since its introduction, however, EJB-QL has been proven to have the following disadvantages:                EJB-QL is not as expressive as SQL. EJB-QL represents a least common denominator that does not capture all of the features that different vendors have added to their databases over the years. For example, certain SQL queries cannot be expressed using EJB-QL. This often forces users to abandon EJB-QL or deters them from using it to begin with.        EJB-QL is different from SQL. While this is its main advantage as stated above, it is also a disadvantage because it requires EJB developers to learn a new query language. It will be difficult for developers to master multiple query languages efficiently, such as SQL, EJB-QL, etc.        